using MoonFramework.Scripts.View.Music;
using MoonFramework.View;

namespace MoonFramework.FSM
{
    public abstract class HurtState : BaseState
    {
        public override void Enter()
        {
            //播放动画与音效
            AnimancerManager.Instance.Play(_actor.viewController._HurtAnimation, _actor?.viewController.AnimancerComponent);
            
            //硬直时间
            _actor.viewController.AddAnimationEvent(nameof(HuetOver), HuetOver);
        }
        
        public override void Exit()
        {
            _actor.viewController.RemoveAnimationEvent(nameof(HuetOver), HuetOver);
        }

        protected abstract void HuetOver();
    }
}